package com.my.chapter12;

public class practice1 {
    static void f() throws MyException{
        System.out.println("Throwing MyException from f()");
        throw new MyException("Originated in f()");
    }

    public static void main(String[] args) {
        try {
            f();
        }catch (MyException e){
            e.printStackTrace(System.out);
        }finally {
            System.out.println("finally");
        }
    }
}

class MyException extends Exception{
    public MyException(){}
    public MyException(String msg){
        super(msg);
    }
}
